import React from 'react';
import * as echarts from 'echarts';


function One(props) {

    setTimeout(() => {
        var chartDom = document.getElementById('main');
var myChart = echarts.init(chartDom);
var option;

option = {
  title: {
    text: '访问来源',
    left: 'center'
  },
  tooltip: {
    trigger: 'item'
  },
  legend: {
    orient: 'vertical',
    left: 'left'
  },
  series: [
    {
      name: 'Access From',
      type: 'pie',
      radius: '50%',
      left:'30',
      top:'10',
      data: [
        { value: 2900, name: 'PC' },
        { value: 735, name: '微信小程序' },
        { value: 580, name: '安卓App' },
        { value: 580, name: 'ios' },
      ],
      emphasis: {
        itemStyle: {
          shadowBlur: 10,
          shadowOffsetX: 0,
          shadowColor: 'red'
        }
      }
    }
  ]
};

option && myChart.setOption(option);
    }, 200);
    
    return (

        
        <div>
            <div id="main" style={{width:400,height:250}}></div>
        </div>
    );
}

export default One;